package workbench.VO;

import java.util.List;

public class ListAndObject<T> {
    private List dataList;
    private T object;

    @Override
    public String toString() {
        return "ListAndObject{" +
                "dataList=" + dataList +
                ", object=" + object +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ListAndObject<?> that = (ListAndObject<?>) o;

        if (getDataList() != null ? !getDataList().equals(that.getDataList()) : that.getDataList() != null)
            return false;
        return getObject() != null ? getObject().equals(that.getObject()) : that.getObject() == null;
    }

    @Override
    public int hashCode() {
        int result = getDataList() != null ? getDataList().hashCode() : 0;
        result = 31 * result + (getObject() != null ? getObject().hashCode() : 0);
        return result;
    }

    public List getDataList() {
        return dataList;
    }

    public void setDataList(List dataList) {
        this.dataList = dataList;
    }

    public T getObject() {
        return object;
    }

    public void setObject(T object) {
        this.object = object;
    }

    public ListAndObject(List dataList, T object) {
        this.dataList = dataList;
        this.object = object;
    }

    public ListAndObject() {
    }
}
